-
Notifications
You must be signed in to change notification settings - Fork 730
feat(auth): switch legacy IAuthorizationPolicy to IAuthorizationService impl [PPUC-318] #6027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
17f96d9 to
05e472b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Commit fixing system IT test issues was moved to: #6036. |
05e472b to
e48deeb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e48deeb to
0868674
Compare
|
(reworded the commit and PR description, from PPUC-122, to the new story, PPUC-318, but kept the branch name, to avoid having to close this PR) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0868674 to
55c8311
Compare
|
Updated the PR to include caching support for the authorization service and authorization action service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces an authorization decision caching mechanism to improve the performance of authorization operations in the Pentaho platform. The PR switches from the legacy IAuthorizationPolicy to a new IAuthorizationService implementation with comprehensive caching support.
- Added authorization decision caching infrastructure with cache invalidation capabilities
- Refactored authorization service to use caching and updated Spring configuration
- Added management endpoints and UI menu items for cache administration
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/org/pentaho/platform/engine/security/authorization/core/caching/MemoryAuthorizationDecisionCache.java | New authorization decision cache implementation using Guava cache with session-based invalidation |
| core/src/main/java/org/pentaho/platform/engine/security/authorization/core/CachingAuthorizationService.java | Caching wrapper for authorization service that uses the decision cache |
| core/src/main/java/org/pentaho/platform/engine/security/authorization/PentahoSystemAuthorizationActionService.java | Refactored service to use plugin manager listener for cache refresh on plugin changes |
| assemblies/pentaho-solutions/src/main/resources/pentaho-solutions/system/pentahoObjects.spring.xml | Spring configuration updates to wire caching authorization service and decision cache |
| user-console/src/main/java/org/pentaho/mantle/client/commands/PurgeAuthorizationDecisionCacheCommand.java | New GWT command for purging authorization cache via UI |
| extensions/src/main/java/org/pentaho/platform/web/http/api/resources/SystemRefreshResource.java | REST endpoint for authorization cache management |
| repository/src/main/java/org/pentaho/platform/security/userroledao/jackrabbit/AbstractJcrBackedUserRoleDao.java | Cache invalidation integration for user role changes |
| core/src/main/java/org/pentaho/platform/engine/security/SecurityHelper.java | Fixed session resource leak in runAsAnonymous method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...src/main/java/org/pentaho/platform/engine/security/authorization/core/AuthorizationRole.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/ResourceAuthorizationRequest.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/ResourceAuthorizationRequest.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/GenericAuthorizationResource.java
Show resolved
Hide resolved
.../main/java/org/pentaho/platform/engine/security/authorization/core/AuthorizationRequest.java
Show resolved
Hide resolved
assemblies/pentaho-solutions/src/main/resources/pentaho-solutions/system/repository.spring.xml
Show resolved
Hide resolved
loonatic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dcf35eb to
c66735b
Compare
…ce impl [PPUC-318]
c66735b to
0522baf
Compare
…ce [PPUC-318] - refreshes the auth actions cache when plugin manager reloads
…olicyRoleBindingDao [PPUC-318] - invalidates cache when role permissions change
…318] - invalidates cache when users' roles change
…s impls [PPUC-318]
0522baf to
7b78d70
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…n cache [PPUC-318] - depends on i18n added to pentaho-commons-gwt
…s [PPUC-318] - provided for flexibility for rules that for some not so good reason depend on the service singleton itself
7b78d70 to
b231635
Compare
Analysis Details1 IssueCoverage and DuplicationsProject ID: pentaho:pentaho-platform-ce-parent |
Note:Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system. |
✅ Build finished in 44m 45sBuild command: mvn clean verify -B -e -Daudit -Djs.no.sandbox -pl \
api,assemblies/pentaho-solutions,assemblies/pentaho-war,core,extensions,repository,user-console👌 All tests passed! Tests run: 3282, Failures: 0, Skipped: 1 Test Results ℹ️ This is an automatic message |







Please, check each commit for a more local description (title) and set of changes.
Besides actual features, there are a couple of commits dealing with fixes and small performance optimizations.
feat(auth): switch legacy IAuthorizationPolicy to IAuthorizationService impl [PPUC-318]
feat(auth): caching support for AuthorizationService [PPUC-318]
fix(auth): SecurityHelper.runAsAnonymous not destroying StandaloneSession [PPUC-318]
fix: CacheManager onLogout not properly clearing the session cache [PPUC-318]
feat(auth): add default log configuration for authorization classes [PPUC-318]
feat(auth): caching support for PentahoSystemAuthorizationActionService [PPUC-318]
chore(auth): performance of default authorization options [PPUC-318]
feat(auth): endpoint and old PUC menu item to invalidate authorization cache [PPUC-318]
feat(auth): define AuthorizationService#setRootRule(.) to allow cycles [PPUC-318]
chore(auth): logging improvements and some linting [PPUC-318]
Issue: https://hv-eng.atlassian.net/browse/PPUC-318
To be merged with:
Copilot Summary
This pull request introduces a new caching mechanism for authorization decisions and refactors how default authorization options are provided. It also updates Spring configuration files to wire up the new cache and related services, improves logging for authorization components, and makes a minor resource management fix in the security helper.
Authorization Decision Caching
IAuthorizationDecisionCacheandIAuthorizationDecisionCacheKeyto support caching of authorization decisions, following a loading cache pattern. [1] [2]authorizationDecisionCacheusingMemoryAuthorizationDecisionCachein Spring configuration, with configurable expiration and size.Service and Options Refactoring
IAuthorizationOptions.getDefault()to return a singletonDefaultAuthorizationOptions.INSTANCEinstead of an anonymous inner class, moving the implementation to a dedicated class. [1] [2] [3]Spring Configuration Updates
CachingAuthorizationService) and to inject the decision cache where needed, including repository and authorization policy beans. [1] [2] [3]Logging Improvements
org.pentaho.platform.engine.security.authorizationat the ERROR level inlog4j2.xmlfor better visibility of authorization-related issues.Code Cleanup and Resource Management
SecurityHelper.runAsAnonymousby ensuring the anonymous session is destroyed after use. Also reordered imports for clarity. [1] [2] [3] [4]These changes collectively improve authorization performance and maintainability, and prepare the platform for more robust security features.